package net.skyaims.sqlmgr.dao;

import java.util.List;

import net.skyaims.sqlmgr.domain.IdcServer;

import org.skife.jdbi.v2.sqlobject.Bind;
import org.skife.jdbi.v2.sqlobject.SqlQuery;
import org.skife.jdbi.v2.sqlobject.SqlUpdate;
import org.skife.jdbi.v2.sqlobject.customizers.Mapper;

public interface IdcServerDao {

	@SqlQuery("SELECT * FROM b_idc_iplist i WHERE i.sid = :id")
	@Mapper(IdcServer.class)
	IdcServer getIdcBySid(@Bind("sid") Integer sid);

	@SqlQuery("SELECT * FROM b_idc_iplist")
	@Mapper(IdcServer.class)
	List<IdcServer> getAll();

	@SqlUpdate("UPDATE b_idc_iplist i SET i.uuid = :uuid WHERE i.sid = :sid")
	void updateUuidById(@Bind("sid") int sid, @Bind("uuid") String uuid);

}
